package com.itcast.contraller;

import com.itcast.pojo.JobOption;
import com.itcast.pojo.Result;
import com.itcast.service.ReportServerice;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@Slf4j
@RestController
public class ReportController {
    @Autowired
    private ReportServerice reportServerice;
    @GetMapping("/report/empJobData")
    public Result reportJobEmpData() {
        log.info("开始查询报表数据:工作");
        JobOption jobOption = reportServerice.getJobEmpData();
        return Result.success(jobOption);
    }

    @GetMapping("/report/empGenderData")
    public Result reportGenderEmpData() {
        log.info("开始查询报表数据:性别");
        List<Map<String, Integer>> mapList = reportServerice.getGenderEmpData();
        return Result.success(mapList);
    }
}
